package com.sdutcm.Mapper;

/*
 *@Author Yan
 *@Create 2019-08-28 11:09
 */

import com.sdutcm.Shiro.Role;
import com.sdutcm.Shiro.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RealmMapper {

    @Select("select * from User where username = #{value}")
    public User findByUsername(String username);

//    获取权限和角色
    @Select("select * from User u,Role r,user_role ur where username = ${username} and u.id = ur.userId and r.id = ur.roleId")
    public List<Role> selectRoleList(String username);

}
